Skip to main content

Add Reseller Credit API

POST /addResellerCredit

Description

This API endpoint allows an admin to add credit to a reseller's account by providing the reseller's ID and the amount of credit to be added. The added credit can be used by the reseller for various transactions within the platform.

Request Body

The request utilizes GraphQL to perform the addResellerCredit mutation.

Mutation:

mutation addResellerCredit ($resellerId: Int!, $credit: String!) {
addResellerCredit (resellerId: $resellerId, credit: $credit) {
id
email
firstName
lastName
credit
level
phone
}
}

Variables:

{
"resellerId": 0,
"credit": "<Credit_Amount>"
}
  • resellerId (Int): The unique identifier of the reseller to whom credit is being added.
  • credit (String): The amount of credit to be added to the reseller's account. This should be provided in the appropriate currency or unit of value as defined by your platform.

Response:

  • Success (200 OK):

    • If the credit addition is successful, the response will return the updated reseller's details, including their ID, email, and new credit balance.
    {
    "data": {
    "addResellerCredit": {
    "id": "<Reseller_ID>",
    "email": "<Reseller_Email>",
    "firstName": "<First_Name>",
    "lastName": "<Last_Name>",
    "credit": "<Updated_Credit_Amount>",
    "level": "<Reseller_Level>",
    "phone": "<Phone_Number>"
    }
    }
    }
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid reseller ID, missing required fields, or server errors.

Note:

Ensure that the resellerId corresponds to an existing reseller and that the credit amount is correctly formatted and valid within the platform's specifications. This API should be used by admins with the necessary permissions to manage reseller accounts and credit balances.